package com.itheima.demo06;

public class MainClass {
    public static void main(String[] args) {
        //匿名内部类
        useShowHandler(new ShowHandler() {
            @Override
            public void show() {
                System.out.println("匿名内部类打印的show方法");
            }
        });
        //Lambda函数表达式编程
        useShowHandler(()->
            System.out.println("Lambda打印的show方法")
        );
    }

    public static void useShowHandler(ShowHandler handler){
        handler.show();
    }
}

interface ShowHandler{
    void show();
}
